<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="/template.xhtml">
	<ui:define name="body">
		<a4j:form>
			<rich:panel>
				<f:facet name="header">Encuesta</f:facet>
				<h:panelGrid columns="2">
					<h:outputText value="Etiqueta" styleClass="title1" />
					<h:inputText value="#{main.encuesta.etiqueta}" />
					<h:outputText value="Familia" styleClass="title1"
						rendered="#{main.modificandoInfoFamiliar}" />
					<h:inputText value="#{main.idFamilia}"
						rendered="#{main.modificandoInfoFamiliar}" />
					<h:outputText value="Etiqueta Instalada" styleClass="title1" />
					<h:panelGroup>
						<h:selectOneRadio value="#{main.encuesta.etiquetaInstalada}">
							<f:selectItem itemValue="1" itemLabel="Si" />
							<f:selectItem itemValue="0" itemLabel="No" />
						</h:selectOneRadio>
					</h:panelGroup>
					<a4j:commandButton value="Consultar"
						action="#{main.consultarEncabezadoSocial}"
						reRender="panelInfoFamiliar" />
					<rich:spacer />
					<rich:spacer />
					<rich:spacer />
					<rich:spacer />
				</h:panelGrid>
			</rich:panel>
			<a4j:keepAlive beanName="main" ajaxOnly="true" />
			<rich:tabPanel switchType="client"
				rendered="#{!main.modificandoInfoFamiliar}">
				<rich:tab label="#{msg['tabs.identificacion']}">
					<a4j:include viewId="/identificacion.xhtml" />
				</rich:tab>
				<rich:tab label="#{msg['tabs.reconocimiento']}">
					<a4j:include viewId="/reconocimiento.xhtml" />
				</rich:tab>
				<rich:tab label="#{msg['tabs.caracterizacion']}">
					<a4j:include viewId="/caracterizacion.xhtml" />
				</rich:tab>
				<rich:tab label="#{msg['tabs.aspectos']}">
					<a4j:include viewId="/aspectos_sociales.xhtml" />
				</rich:tab>
				<rich:tab label="#{msg['tabs.registrofoto']}">
					<a4j:include viewId="/registro_fotografico.xhtml" />
				</rich:tab>
				<rich:tab label="#{msg['tabs.riesgo']}">
					<a4j:include viewId="/calificacion.xhtml" />
				</rich:tab>
			</rich:tabPanel>
			<a4j:outputPanel id="panelInfoFamiliar">
				<rich:tabPanel switchType="client" id="tabPanelInfoFamiliar"
					rendered="#{main.modificandoInfoFamiliar and main.infoFamiliarConsultada}">
					<rich:tab label="Aspectos sociales (Informacion Familiar*)">
						<a4j:include viewId="/aspectos_sociales_info_familiar.xhtml" />
					</rich:tab>
				</rich:tabPanel>
			</a4j:outputPanel>
			<div style="text-align: right;"><a4j:commandButton
				value="    Guardar completo    " action="${main.guardarCompleto}"
				rendered="#{!main.modificandoInfoFamiliar}" /> <a4j:commandButton
				value="#{!main.modificandoInfoFamiliar ? '    Guardar parcial     ' : 'Guardar'}"
				action="#{main.guardarParcial}" /> <h:commandButton
				value="        Cancelar        " action="cancelar" /></div>
		</a4j:form>
	</ui:define>
</ui:composition>
